{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "88a39ba6-8e4a-496a-affa-bbd4ea6ac809",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "42fa1d19-ed62-4473-bd72-566bee727c21",
   "metadata": {},
   "outputs": [],
   "source": [
    "train_data = pd.read_csv('./锂离子电池生产参数调控及生产温度预测挑战赛公开数据-初赛/train.csv')\n",
    "test_data = pd.read_csv('./锂离子电池生产参数调控及生产温度预测挑战赛公开数据-初赛/test.csv')\n",
    "submit = pd.read_csv('./提交示例.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "09d35017-dc3c-44b5-b78a-5c5a2c0c0071",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>序号</th>\n",
       "      <th>时间</th>\n",
       "      <th>流量1</th>\n",
       "      <th>流量2</th>\n",
       "      <th>流量3</th>\n",
       "      <th>流量4</th>\n",
       "      <th>流量5</th>\n",
       "      <th>流量6</th>\n",
       "      <th>流量7</th>\n",
       "      <th>流量8</th>\n",
       "      <th>...</th>\n",
       "      <th>下部温度8</th>\n",
       "      <th>下部温度9</th>\n",
       "      <th>下部温度10</th>\n",
       "      <th>下部温度11</th>\n",
       "      <th>下部温度12</th>\n",
       "      <th>下部温度13</th>\n",
       "      <th>下部温度14</th>\n",
       "      <th>下部温度15</th>\n",
       "      <th>下部温度16</th>\n",
       "      <th>下部温度17</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2022/11/6 9:08</td>\n",
       "      <td>35.668999</td>\n",
       "      <td>36.146000</td>\n",
       "      <td>25.558001</td>\n",
       "      <td>26.195000</td>\n",
       "      <td>25.670000</td>\n",
       "      <td>15.702</td>\n",
       "      <td>16.690001</td>\n",
       "      <td>15.991</td>\n",
       "      <td>...</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>2022/11/6 9:09</td>\n",
       "      <td>35.995998</td>\n",
       "      <td>36.347000</td>\n",
       "      <td>25.382000</td>\n",
       "      <td>26.348000</td>\n",
       "      <td>26.131001</td>\n",
       "      <td>15.523</td>\n",
       "      <td>16.825001</td>\n",
       "      <td>15.871</td>\n",
       "      <td>...</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>2022/11/6 9:11</td>\n",
       "      <td>35.340000</td>\n",
       "      <td>36.311001</td>\n",
       "      <td>25.469999</td>\n",
       "      <td>26.093000</td>\n",
       "      <td>25.639000</td>\n",
       "      <td>15.564</td>\n",
       "      <td>15.564000</td>\n",
       "      <td>15.947</td>\n",
       "      <td>...</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>2022/11/6 9:12</td>\n",
       "      <td>35.585999</td>\n",
       "      <td>36.091000</td>\n",
       "      <td>25.250000</td>\n",
       "      <td>26.127001</td>\n",
       "      <td>25.670000</td>\n",
       "      <td>15.575</td>\n",
       "      <td>16.775999</td>\n",
       "      <td>15.936</td>\n",
       "      <td>...</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>2022/11/6 9:13</td>\n",
       "      <td>35.946999</td>\n",
       "      <td>36.256001</td>\n",
       "      <td>25.163000</td>\n",
       "      <td>26.399000</td>\n",
       "      <td>25.837999</td>\n",
       "      <td>15.460</td>\n",
       "      <td>16.580999</td>\n",
       "      <td>15.795</td>\n",
       "      <td>...</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>827</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26651</th>\n",
       "      <td>26652</td>\n",
       "      <td>2023/3/1 3:49</td>\n",
       "      <td>24.594000</td>\n",
       "      <td>24.377001</td>\n",
       "      <td>29.191999</td>\n",
       "      <td>25.551001</td>\n",
       "      <td>27.016001</td>\n",
       "      <td>4.377</td>\n",
       "      <td>21.929001</td>\n",
       "      <td>24.459</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26652</th>\n",
       "      <td>26653</td>\n",
       "      <td>2023/3/1 3:54</td>\n",
       "      <td>24.379000</td>\n",
       "      <td>24.424999</td>\n",
       "      <td>29.253000</td>\n",
       "      <td>25.652000</td>\n",
       "      <td>27.188000</td>\n",
       "      <td>4.415</td>\n",
       "      <td>22.017000</td>\n",
       "      <td>24.534</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26653</th>\n",
       "      <td>26654</td>\n",
       "      <td>2023/3/1 4:00</td>\n",
       "      <td>24.407000</td>\n",
       "      <td>24.312000</td>\n",
       "      <td>29.010000</td>\n",
       "      <td>25.382000</td>\n",
       "      <td>26.813000</td>\n",
       "      <td>4.354</td>\n",
       "      <td>21.726000</td>\n",
       "      <td>24.204</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26654</th>\n",
       "      <td>26655</td>\n",
       "      <td>2023/3/1 4:05</td>\n",
       "      <td>24.636000</td>\n",
       "      <td>24.409000</td>\n",
       "      <td>29.162001</td>\n",
       "      <td>25.551001</td>\n",
       "      <td>27.032000</td>\n",
       "      <td>4.362</td>\n",
       "      <td>21.813000</td>\n",
       "      <td>21.813</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26655</th>\n",
       "      <td>26656</td>\n",
       "      <td>2023/3/1 4:10</td>\n",
       "      <td>24.236000</td>\n",
       "      <td>24.054001</td>\n",
       "      <td>28.874001</td>\n",
       "      <td>25.282000</td>\n",
       "      <td>27.125000</td>\n",
       "      <td>4.384</td>\n",
       "      <td>21.944000</td>\n",
       "      <td>24.444</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>26656 rows × 87 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          序号              时间        流量1        流量2        流量3        流量4  \\\n",
       "0          1  2022/11/6 9:08  35.668999  36.146000  25.558001  26.195000   \n",
       "1          2  2022/11/6 9:09  35.995998  36.347000  25.382000  26.348000   \n",
       "2          3  2022/11/6 9:11  35.340000  36.311001  25.469999  26.093000   \n",
       "3          4  2022/11/6 9:12  35.585999  36.091000  25.250000  26.127001   \n",
       "4          5  2022/11/6 9:13  35.946999  36.256001  25.163000  26.399000   \n",
       "...      ...             ...        ...        ...        ...        ...   \n",
       "26651  26652   2023/3/1 3:49  24.594000  24.377001  29.191999  25.551001   \n",
       "26652  26653   2023/3/1 3:54  24.379000  24.424999  29.253000  25.652000   \n",
       "26653  26654   2023/3/1 4:00  24.407000  24.312000  29.010000  25.382000   \n",
       "26654  26655   2023/3/1 4:05  24.636000  24.409000  29.162001  25.551001   \n",
       "26655  26656   2023/3/1 4:10  24.236000  24.054001  28.874001  25.282000   \n",
       "\n",
       "             流量5     流量6        流量7     流量8  ...  下部温度8  下部温度9  下部温度10  \\\n",
       "0      25.670000  15.702  16.690001  15.991  ...    827    827     827   \n",
       "1      26.131001  15.523  16.825001  15.871  ...    827    827     827   \n",
       "2      25.639000  15.564  15.564000  15.947  ...    827    827     827   \n",
       "3      25.670000  15.575  16.775999  15.936  ...    827    827     827   \n",
       "4      25.837999  15.460  16.580999  15.795  ...    827    827     827   \n",
       "...          ...     ...        ...     ...  ...    ...    ...     ...   \n",
       "26651  27.016001   4.377  21.929001  24.459  ...    837    837     837   \n",
       "26652  27.188000   4.415  22.017000  24.534  ...    837    837     837   \n",
       "26653  26.813000   4.354  21.726000  24.204  ...    837    837     837   \n",
       "26654  27.032000   4.362  21.813000  21.813  ...    837    837     837   \n",
       "26655  27.125000   4.384  21.944000  24.444  ...    837    837     837   \n",
       "\n",
       "       下部温度11  下部温度12  下部温度13  下部温度14  下部温度15  下部温度16  下部温度17  \n",
       "0         827     827     827     827     827     827     750  \n",
       "1         827     827     827     827     827     827     750  \n",
       "2         827     827     827     827     827     827     750  \n",
       "3         827     827     827     827     827     827     750  \n",
       "4         827     827     827     827     827     827     750  \n",
       "...       ...     ...     ...     ...     ...     ...     ...  \n",
       "26651     837     837     837     837     837     837     750  \n",
       "26652     837     837     837     837     837     837     750  \n",
       "26653     837     837     837     837     837     837     750  \n",
       "26654     837     837     837     837     837     837     750  \n",
       "26655     837     837     837     837     837     837     750  \n",
       "\n",
       "[26656 rows x 87 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "747251a9-0ec3-4b34-a5cb-6074b63bc34b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1        1\n",
       "17910    1\n",
       "17778    1\n",
       "17777    1\n",
       "17776    1\n",
       "        ..\n",
       "8883     1\n",
       "8882     1\n",
       "8881     1\n",
       "8880     1\n",
       "26656    1\n",
       "Name: 序号, Length: 26656, dtype: int64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data['序号'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "e0f82d62-00a1-4c38-808f-89de2983bc51",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>序号</th>\n",
       "      <th>时间</th>\n",
       "      <th>流量1</th>\n",
       "      <th>流量2</th>\n",
       "      <th>流量3</th>\n",
       "      <th>流量4</th>\n",
       "      <th>流量5</th>\n",
       "      <th>流量6</th>\n",
       "      <th>流量7</th>\n",
       "      <th>流量8</th>\n",
       "      <th>...</th>\n",
       "      <th>下部温度设定8</th>\n",
       "      <th>下部温度设定9</th>\n",
       "      <th>下部温度设定10</th>\n",
       "      <th>下部温度设定11</th>\n",
       "      <th>下部温度设定12</th>\n",
       "      <th>下部温度设定13</th>\n",
       "      <th>下部温度设定14</th>\n",
       "      <th>下部温度设定15</th>\n",
       "      <th>下部温度设定16</th>\n",
       "      <th>下部温度设定17</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/3/1 4:15</td>\n",
       "      <td>24.222000</td>\n",
       "      <td>24.070000</td>\n",
       "      <td>28.889000</td>\n",
       "      <td>25.264999</td>\n",
       "      <td>26.827999</td>\n",
       "      <td>4.354000</td>\n",
       "      <td>21.784000</td>\n",
       "      <td>24.323000</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>2023/3/1 4:20</td>\n",
       "      <td>24.138000</td>\n",
       "      <td>23.974001</td>\n",
       "      <td>28.798000</td>\n",
       "      <td>25.517000</td>\n",
       "      <td>27.108999</td>\n",
       "      <td>4.377000</td>\n",
       "      <td>21.886000</td>\n",
       "      <td>24.384001</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>2023/3/1 4:26</td>\n",
       "      <td>24.152000</td>\n",
       "      <td>24.006001</td>\n",
       "      <td>28.827999</td>\n",
       "      <td>25.114000</td>\n",
       "      <td>26.719999</td>\n",
       "      <td>4.293000</td>\n",
       "      <td>21.611000</td>\n",
       "      <td>24.099001</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>2023/3/1 4:31</td>\n",
       "      <td>24.108999</td>\n",
       "      <td>23.974001</td>\n",
       "      <td>28.783001</td>\n",
       "      <td>25.114000</td>\n",
       "      <td>27.047001</td>\n",
       "      <td>4.354000</td>\n",
       "      <td>21.857000</td>\n",
       "      <td>24.337999</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>2023/3/1 4:36</td>\n",
       "      <td>24.350000</td>\n",
       "      <td>24.215000</td>\n",
       "      <td>29.146999</td>\n",
       "      <td>25.416000</td>\n",
       "      <td>25.416000</td>\n",
       "      <td>4.377000</td>\n",
       "      <td>21.900000</td>\n",
       "      <td>24.444000</td>\n",
       "      <td>...</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>837</td>\n",
       "      <td>750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11419</th>\n",
       "      <td>11420</td>\n",
       "      <td>2023/5/17 23:38</td>\n",
       "      <td>20.496000</td>\n",
       "      <td>26.597000</td>\n",
       "      <td>25.483999</td>\n",
       "      <td>28.426001</td>\n",
       "      <td>29.061001</td>\n",
       "      <td>24.259001</td>\n",
       "      <td>26.860001</td>\n",
       "      <td>16.997999</td>\n",
       "      <td>...</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>680</td>\n",
       "      <td>680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11420</th>\n",
       "      <td>11421</td>\n",
       "      <td>2023/5/17 23:44</td>\n",
       "      <td>20.098000</td>\n",
       "      <td>26.614000</td>\n",
       "      <td>25.926001</td>\n",
       "      <td>28.409000</td>\n",
       "      <td>28.667000</td>\n",
       "      <td>24.290001</td>\n",
       "      <td>26.709000</td>\n",
       "      <td>16.862000</td>\n",
       "      <td>...</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>680</td>\n",
       "      <td>680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11421</th>\n",
       "      <td>11422</td>\n",
       "      <td>2023/5/17 23:49</td>\n",
       "      <td>20.052999</td>\n",
       "      <td>26.580000</td>\n",
       "      <td>25.646000</td>\n",
       "      <td>28.202000</td>\n",
       "      <td>29.077000</td>\n",
       "      <td>24.181999</td>\n",
       "      <td>26.525000</td>\n",
       "      <td>16.886000</td>\n",
       "      <td>...</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>680</td>\n",
       "      <td>680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11422</th>\n",
       "      <td>11423</td>\n",
       "      <td>2023/5/17 23:54</td>\n",
       "      <td>20.267000</td>\n",
       "      <td>26.410999</td>\n",
       "      <td>25.896999</td>\n",
       "      <td>28.546000</td>\n",
       "      <td>28.587999</td>\n",
       "      <td>24.430000</td>\n",
       "      <td>26.542000</td>\n",
       "      <td>16.934999</td>\n",
       "      <td>...</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>680</td>\n",
       "      <td>680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11423</th>\n",
       "      <td>11424</td>\n",
       "      <td>2023/5/17 23:59</td>\n",
       "      <td>20.323000</td>\n",
       "      <td>26.294001</td>\n",
       "      <td>25.778999</td>\n",
       "      <td>28.289000</td>\n",
       "      <td>28.289000</td>\n",
       "      <td>24.243999</td>\n",
       "      <td>26.691999</td>\n",
       "      <td>16.825001</td>\n",
       "      <td>...</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>786</td>\n",
       "      <td>680</td>\n",
       "      <td>680</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>11424 rows × 53 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          序号               时间        流量1        流量2        流量3        流量4  \\\n",
       "0          1    2023/3/1 4:15  24.222000  24.070000  28.889000  25.264999   \n",
       "1          2    2023/3/1 4:20  24.138000  23.974001  28.798000  25.517000   \n",
       "2          3    2023/3/1 4:26  24.152000  24.006001  28.827999  25.114000   \n",
       "3          4    2023/3/1 4:31  24.108999  23.974001  28.783001  25.114000   \n",
       "4          5    2023/3/1 4:36  24.350000  24.215000  29.146999  25.416000   \n",
       "...      ...              ...        ...        ...        ...        ...   \n",
       "11419  11420  2023/5/17 23:38  20.496000  26.597000  25.483999  28.426001   \n",
       "11420  11421  2023/5/17 23:44  20.098000  26.614000  25.926001  28.409000   \n",
       "11421  11422  2023/5/17 23:49  20.052999  26.580000  25.646000  28.202000   \n",
       "11422  11423  2023/5/17 23:54  20.267000  26.410999  25.896999  28.546000   \n",
       "11423  11424  2023/5/17 23:59  20.323000  26.294001  25.778999  28.289000   \n",
       "\n",
       "             流量5        流量6        流量7        流量8  ...  下部温度设定8  下部温度设定9  \\\n",
       "0      26.827999   4.354000  21.784000  24.323000  ...      837      837   \n",
       "1      27.108999   4.377000  21.886000  24.384001  ...      837      837   \n",
       "2      26.719999   4.293000  21.611000  24.099001  ...      837      837   \n",
       "3      27.047001   4.354000  21.857000  24.337999  ...      837      837   \n",
       "4      25.416000   4.377000  21.900000  24.444000  ...      837      837   \n",
       "...          ...        ...        ...        ...  ...      ...      ...   \n",
       "11419  29.061001  24.259001  26.860001  16.997999  ...      786      786   \n",
       "11420  28.667000  24.290001  26.709000  16.862000  ...      786      786   \n",
       "11421  29.077000  24.181999  26.525000  16.886000  ...      786      786   \n",
       "11422  28.587999  24.430000  26.542000  16.934999  ...      786      786   \n",
       "11423  28.289000  24.243999  26.691999  16.825001  ...      786      786   \n",
       "\n",
       "       下部温度设定10  下部温度设定11  下部温度设定12  下部温度设定13  下部温度设定14  下部温度设定15  下部温度设定16  \\\n",
       "0           837       837       837       837       837       837       837   \n",
       "1           837       837       837       837       837       837       837   \n",
       "2           837       837       837       837       837       837       837   \n",
       "3           837       837       837       837       837       837       837   \n",
       "4           837       837       837       837       837       837       837   \n",
       "...         ...       ...       ...       ...       ...       ...       ...   \n",
       "11419       786       786       786       786       786       786       680   \n",
       "11420       786       786       786       786       786       786       680   \n",
       "11421       786       786       786       786       786       786       680   \n",
       "11422       786       786       786       786       786       786       680   \n",
       "11423       786       786       786       786       786       786       680   \n",
       "\n",
       "       下部温度设定17  \n",
       "0           750  \n",
       "1           750  \n",
       "2           750  \n",
       "3           750  \n",
       "4           750  \n",
       "...         ...  \n",
       "11419       680  \n",
       "11420       680  \n",
       "11421       680  \n",
       "11422       680  \n",
       "11423       680  \n",
       "\n",
       "[11424 rows x 53 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "b15479e5-35cf-4b42-90a5-6a675dd6c542",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "序号                      1\n",
       "时间          2023/3/1 4:15\n",
       "流量1                24.222\n",
       "流量2                 24.07\n",
       "流量3                28.889\n",
       "流量4             25.264999\n",
       "流量5             26.827999\n",
       "流量6                 4.354\n",
       "流量7                21.784\n",
       "流量8                24.323\n",
       "流量9             16.721001\n",
       "流量10               18.652\n",
       "流量11               18.652\n",
       "流量12               13.788\n",
       "流量13               13.352\n",
       "流量14               13.516\n",
       "流量15               17.993\n",
       "流量16            16.573999\n",
       "流量17               40.132\n",
       "上部温度设定1               200\n",
       "上部温度设定2               300\n",
       "上部温度设定3               400\n",
       "上部温度设定4               500\n",
       "上部温度设定5               500\n",
       "上部温度设定6               600\n",
       "上部温度设定7               720\n",
       "上部温度设定8               837\n",
       "上部温度设定9               837\n",
       "上部温度设定10              837\n",
       "上部温度设定11              837\n",
       "上部温度设定12              837\n",
       "上部温度设定13              837\n",
       "上部温度设定14              837\n",
       "上部温度设定15              837\n",
       "上部温度设定16              837\n",
       "上部温度设定17              750\n",
       "下部温度设定1               200\n",
       "下部温度设定2               300\n",
       "下部温度设定3               400\n",
       "下部温度设定4               500\n",
       "下部温度设定5               500\n",
       "下部温度设定6               600\n",
       "下部温度设定7               720\n",
       "下部温度设定8               837\n",
       "下部温度设定9               837\n",
       "下部温度设定10              837\n",
       "下部温度设定11              837\n",
       "下部温度设定12              837\n",
       "下部温度设定13              837\n",
       "下部温度设定14              837\n",
       "下部温度设定15              837\n",
       "下部温度设定16              837\n",
       "下部温度设定17              750\n",
       "Name: 0, dtype: object"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_data.iloc[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "06665691-e9dc-4e93-9bda-a0763128cbae",
   "metadata": {},
   "outputs": [],
   "source": [
    "for col in ['上部温度1', '上部温度2', '上部温度3', '上部温度4', '上部温度5', '上部温度6', '上部温度7',\n",
    "       '上部温度8', '上部温度9', '上部温度10', '上部温度11', '上部温度12', '上部温度13', '上部温度14',\n",
    "       '上部温度15', '上部温度16', '上部温度17', '下部温度1', '下部温度2', '下部温度3', '下部温度4',\n",
    "       '下部温度5', '下部温度6', '下部温度7', '下部温度8', '下部温度9', '下部温度10', '下部温度11',\n",
    "       '下部温度12', '下部温度13', '下部温度14', '下部温度15', '下部温度16', '下部温度17']:\n",
    "    model = LinearRegression().fit(\n",
    "        train_data.drop(['时间'], axis=1).iloc[:, :-34],\n",
    "        train_data[col]\n",
    "    )\n",
    "    submit[col] = model.predict(test_data.drop(['时间'], axis=1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "034d287e-509e-45d1-a00a-719c802ff1ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "submit.to_csv('submit.csv', index=None)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3.10"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
